/**
 * @(#)com.apache.WebServer
 *
 * Copyright (c) 2014-2018 厦门民航凯亚有限公司
 *
 * DESC:
 *
 */
package com.apache;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author fusf
 * @version 1.0  2015/6/29 0029
 */
public class WebServer {

    public void serverStart(int port){
        ServerSocket serverSocket = null;
        try {
            serverSocket = new ServerSocket(port);
            while (true) {
                Socket socket = serverSocket.accept();
                new Processor(socket).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[]arg) {
        new WebServer().serverStart(80);
    }
}
